import {WeaTools} from 'ecCom';

//表单修改日志
export const getModifyLog = (params) => {
	return WeaTools.callApi('/api/workflow/reqform/getModifyLog', 'POST', params);
}

//加载相关资源
export const getFormResourcesKey = params => {
	return WeaTools.callApi('/api/workflow/reqform/resources', 'GET', params);
}

//获取流程接收人
export const getLogAllReceiveUser = (params) => {
    return WeaTools.callApi('/api/workflow/reqform/getLogAllReceiveUser','GET',params)
}

//加载签字意见基本信息
export  const getRequestLogBaseInfo = params => {
    return WeaTools.callApi('/api/workflow/reqform/getRequestLogBaseInfo', 'POST', params);
}

//加载签字意见列表数据
export  const getRequestLogList = params => {
    return WeaTools.callApi('/api/workflow/reqform/getRequestLogList', 'POST', params);
}

//更新意见列表分页
export const updateRequestLogPageSize = params => {
    return WeaTools.callApi('/api/workflow/reqform/updateRequestLogPageSize', 'POST', params);
}
//签字意见更新显示图像
export const updateUserTxStatus = params => {
    return WeaTools.callApi('/api/workflow/reqform/updateUserTxStatus', 'POST', params);
}

//门户流程中心
export const getReqBaseParams = params => {
    return WeaTools.callApi('/api/workflow/wfcenter/getReqBaseParams', 'GET', params);
}

//右键按钮
export const getRightMenu = params => {
    return WeaTools.callApi('/api/workflow/reqform/rightMenu', 'POST', params);
}

export const wfCenterSubmit = params => {
    const {actiontype = ''} = params;
    //流程督办
    if(actiontype === 'doSupervise'){
        params.requestids = params.requestid;
        return WeaTools.callApi('/api/workflow/supervise/doSupervise', 'POST', params);
    }
    return WeaTools.callApi(`/api/workflow/reqform/${actiontype}`, 'POST', params);
}


//请求状态更新(已读等)
export const updateReqInfo = params => {
	return WeaTools.callApi('/api/workflow/reqform/updateReqInfo', 'POST', params);
}


//手写签批生成图片文档
export const saveMobileSignAnnex = params => {
	return WeaTools.callApi('/api/workflow/reqform/saveMobileSignAnnex', 'POST', params);
}

//获取相关流程
export const getWFList = params => {
	return WeaTools.callApi('/api/workflow/reqform/getWFList', 'POST', params);
}

